# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=unshield
pkgver=1.5.1
pkgrel=1
pkgdesc="Extracts CAB files from InstallShield installers"
# Note: only tested on the following archs, may work on others too but not
# adding them until this has been confirmed
arch="x86_64 aarch64 armv7"
url="https://github.com/twogood/unshield"
license="MIT"
makedepends="cmake samurai zlib-dev"
checkdepends="bash"
source="$pkgname-$pkgver.tar.gz::https://github.com/twogood/unshield/archive/$pkgver.tar.gz"
subpackages="
	$pkgname-doc
	$pkgname-dev
	"
options="!check"
# Package includes unit tests but they fail to execute:
# https://github.com/twogood/unshield/issues/99

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	UNSHIELD="$builddir"/src/unshield bash run-tests.sh
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
acb130c461bed66dc3804394be067a68aea96a7cd20b348e713f64a11bf642b74f68fc172f220a9790b44573abbe01ed4585191158f27c40e863918a7342c1ca  unshield-1.5.1.tar.gz
"
